//
//  SEGMenuRequestManager.h
//  SEGPlatform
//
//  Created by 乔杨 on 2020/12/3.
//

#import <Foundation/Foundation.h>
 
#import "SEGOldPGCListViewLayout.h"
#import "SEGMenuListModel.h"
#import "SEGPgcManager.h"
 
typedef void (^seg_menu_block)(BOOL hasTopLine, BOOL hasAd, BOOL hasCommonMenu, NSArray<SEGNeighborRollViewModel *> *neighborTopLineData);
@interface SEGMenuRequestManager : NSObject
 
/// 【类属性】底部tabBar数据
@property (nonatomic, copy, class, readonly) NSArray<SEGMenuListModel *> *menuListTab;
/// 页面菜单数据
@property (nonatomic, copy) NSArray<NSArray<SEGMenuListModel *> *> *menuListDataArr;
/// PGCManager
@property (nonatomic, strong) SEGPgcManager *pgcManager;

#pragma mark - tabBar菜单
/// 请求菜单底部tabBar （中间层，会根据项目取用不同的菜单逻辑）
/// @param completion 回调
+ (void)menu_requestMenuForTabBarCompletion:(void(^)(BOOL isSuccessed, id result, NSString *codeType, NSString *errorMessage))completion;
 
#pragma mark - 页面菜单
/// 请求本地缓存菜单页面数据
/// @param action 页面编码
/// @param settingsId  导航菜单id
/// @param type 广告类型
/// @param completion 回调
- (void)menu_requestLocalMenuForPageWithAction:(NSString *)action settingsId:(NSString *)settingsId positionType:(SEGAdvlistType)type completion:(seg_menu_block)completion;

/// 请求网络菜单页面数据
/// @param menuSid 页面Id
/// @param action 页面编码
/// @param settingsId  导航菜单id
/// @param hotNewsParams 侧滑推荐位参数
/// @param targetVC 控制器
/// @param type 广告类型
/// @param completion 回调
- (void)menu_requestNetworkMenuForPageWithMenuSid:(NSString *)menuSid action:(NSString *)action settingsId:(NSString *)settingsId hotNewsParams:(NSDictionary *)hotNewsParams targetVC:(UIViewController *)targetVC positionType:(SEGAdvlistType)type completion:(seg_menu_block)completion;

/// 查询菜单数据中是否存在导航栏，存在返回数据模型，不存在返回nil
/// @param data 菜单数据
+ (SEGMenuListModel *)menu_getNavigationBarMenuWithData:(NSArray<NSArray<SEGMenuListModel *> *> *)data;

#pragma mark - 老PGC
/// 老PGC数据源
@property (nonatomic, copy) NSArray<SEGOldPGCListViewLayout *> *oldPGCDataSource;
/// 老PGC列表刷新条数
@property (nonatomic, assign) NSInteger oldPGCFreshCount;
/// 请求老PGC列表数据
/// @param pageNo 页数
/// @param pageSize 每页总数
/// @param quizTypeId PGC类型
/// @param isRecommend 是否是推荐位
/// @param finished 回调
- (void)menu_requestOldPGCListWithPageNo:(NSInteger)pageNo PageSize:(NSInteger)pageSize quizTypeId:(NSString *)quizTypeId isRecommend:(NSString *)isRecommend finished:(SEGNetworkReponse)finished;

#pragma mark - 查询菜单数据中是否有H5缴费菜单
/// 查询菜单数据中是否有H5缴费菜单
- (id)menu_getWebBillPayURL;

@end

